<template>
  <div>
    <el-table v-loading="loading" :data="tableData.data" @sort-change="changeTableSort"
              style="width: 100%;font-size: 12px;">
      <el-table-column label="任务名称" prop="schedulingTaskName"
                       width="200">
      </el-table-column>
      <el-table-column label="任务别名" prop="note"
                       width="100">
      </el-table-column>
      <el-table-column label="执行时间" prop="addDate">
      </el-table-column>
    </el-table>
    <div class="page">
      <el-pagination background :current-page="searchObject.no" :page-sizes="[10, 20, 50, 100]"
                     :page-size="tableData.size" :pager-count="5"
                     layout="total, sizes, prev, pager, next, jumper" :page-count="tableData.totalPage"
                     :total="tableData.total" @size-change="sizeChange" @current-change="pageChange">
      </el-pagination>
    </div>
  </div>
</template>

<script>
import common from "@/mixins/common.js";

export default {
  name: "schedulingTask_view",
  mixins: [common],
  data() {
    return {
      viewModel: {},
      activeIndex: "1",
      searchObject: {},
      tableData: {
        size: 0,
        total: 0,
        totalPage: 0,
        data: []
      },
    }
  },
  async mounted() {
    let id = this.$route.query.id;
    this.searchObject.schedulingTask = id;
    this.getSearchList().then();
  },
  methods: {
    async getSearchList() {
      this.loading = true;
      let data = this.searchObject;
      let res = await this.$http.form("/schedulingTaskRecord/search", data);
      if (res.code === 200) {
        this.tableData = res;
      }
      this.loading = false;
    }
  },

}
</script>

<style scoped>

</style>
